<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fn1() {
				var div = document.querySelector("div");
				//获取
				console.log(div.innerHTML);
				console.log(div.innerText);
				//设置
				// div.innerHTML = "<a href='https://www.atstudy.com'>博为峰</a>";
				div.innerText = "<a href='https://www.atstudy.com'>博为峰</a>";
			}
		</script>
	</head>
	<body>
		<div>博为峰</div>
		<button onclick="fn1()">文本操作</button>
	</body>
</html>
